FROM python:3.8-alpine

ENV TZ=Asia/Shanghai

COPY pip.conf /root/.pip/pip.conf
COPY requirements.txt /root/requirements.txt

RUN set -ex \
    && sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
    && apk add --update --no-cache tzdata gcc g++ make \
    && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
    && pip install --upgrade pip \
    && cd /root && pip install -r requirements.txt \
    && mkdir /ELFChatBot \
    && rm -rf /var/cache/apk/* && rm -rf /tmp/* && rm -rf /root/.cache/

WORKDIR /ELFChatBot

CMD [ "nb", "run" ]
